package com.example.demo.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Date;
import java.util.Objects;

@Data
@TableName("t_parameter")
public class ParameterEntity {
    @TableId(value = "ID", type = IdType.AUTO)
    private Long id;

    @TableField("code")
    private String code;

    @TableField("name")
    private String name;

    @TableField("localName")
    private String localName;

    @TableField("description")
    private String description;

    @TableField("startDate")
    private Date startDate;

    @TableField("endDate")
    private Date endDate;

    @TableField("parentCode")
    private String parentCode;

    @TableField("hasChild")
    private Short hasChild;

    @TableField("extendedDescription")
    private String extendedDescription;

    @TableField("security")
    private String security;

    @TableField("userid")
    private Long userid;

    @TableField("operatorType")
    private String operatorType;

    @TableField("autoCache")
    private Short autoCache;

    @TableField("currVersion")
    private Long currVersion;

    @TableField("removed")
    private Short removed;

    @TableField("parameterRootId")
    private Long parameterRootId;

    @TableField("standardCode")
    private String standardCode;

    @TableField("sortType")
    private String sortType;

    @TableField("userCode")
    private String userCode;

    @TableField("chineseDescription")
    private String chineseDescription;

    @TableField("showCode")
    private Short showCode;

    @TableField("createDate")
    private Date createDate;

    @TableField("updateDate")
    private Date updateDate;

    public boolean compare(ParameterEntity that) {
        return  Objects.equals(code, that.code) && Objects.equals(name, that.name) && Objects.equals(localName, that.localName) && Objects.equals(description, that.description) && Objects.equals(startDate, that.startDate) && Objects.equals(endDate, that.endDate) && Objects.equals(parentCode, that.parentCode) && Objects.equals(hasChild, that.hasChild) && Objects.equals(extendedDescription, that.extendedDescription) && Objects.equals(security, that.security) && Objects.equals(userid, that.userid) && Objects.equals(operatorType, that.operatorType) && Objects.equals(autoCache, that.autoCache) && Objects.equals(currVersion, that.currVersion) && Objects.equals(removed, that.removed) && Objects.equals(parameterRootId, that.parameterRootId) && Objects.equals(standardCode, that.standardCode) && Objects.equals(sortType, that.sortType) && Objects.equals(userCode, that.userCode) && Objects.equals(chineseDescription, that.chineseDescription) && Objects.equals(showCode, that.showCode);
    }
}